package com.example.rabbitmqstudy.service;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.example.rabbitmqstudy.constant.RabbitConstant;

/**
 * @author admin
 * @date 2021/07/16 09:07
 */
@Component
public class RabbitRpcConsumer {

    @RabbitListener(queues = RabbitConstant.RPC_QUEUE_NAME)
    @RabbitHandler
    public String rpcQueue(String context){
        System.out.println("rabbit rpc queue receiver: " + context);
        return "copy that!";
    }

}
